import os


class TDXParams:
    # 市场

    MARKET_SZ: int = 0  # 深圳
    MARKET_SH: int = 1  # 上海

    # K线种类
    # K 线种类
    # 0 -   5 分钟K 线
    # 1 -   15 分钟K 线
    # 2 -   30 分钟K 线
    # 3 -   时 K 线
    # 4 -   日 K 线
    # 5 -   周 K 线
    # 6 -   月 K 线
    # 7 -   1 分钟
    # 8 -   1 分钟 K 线
    # 9 -   日 K 线
    # 10 -  季 K 线
    # 11 -  年 K 线

    KLINE_TYPE_5MIN: int = 0
    KLINE_TYPE_15MIN: int = 1
    KLINE_TYPE_30MIN: int = 2
    KLINE_TYPE_1HOUR: int = 3
    KLINE_TYPE_DAILY: int = 4
    KLINE_TYPE_WEEKLY: int = 5
    KLINE_TYPE_MONTHLY: int = 6
    KLINE_TYPE_EXHQ_1MIN: int = 7
    KLINE_TYPE_1MIN: int = 8
    KLINE_TYPE_RI_K: int = 9
    KLINE_TYPE_3MONTH: int = 10
    KLINE_TYPE_YEARLY: int = 11

    # ref : https://github.com/rainx/pytdx/issues/7
    # 分笔行情最多2000条
    MAX_TRANSACTION_COUNT: int = 2000
    # k先数据最多800条
    MAX_KLINE_COUNT: int = 800

    # 板块相关参数
    BLOCK_SZ: str = 'block_zs.dat'
    BLOCK_FG: str = 'block_fg.dat'
    BLOCK_GN: str = 'block_gn.dat'
    BLOCK_DEFAULT: str = 'block.dat'


RSP_HEADER_LEN = 0x10
DEBUG = os.getenv('DEBUG', 1)
CONNECT_TIMEOUT = 5.000
RECV_HEADER_LEN = 0x10
DEFAULT_HEARTBEAT_INTERVAL: float = 10.0
